/*
 * Option.hpp
 *
 *  Created on: 06.05.2011
 *      Author: mifodix
 */

#ifndef OPTION_HPP_
#define OPTION_HPP_

#ifndef __cplusplus
#error Need C++-compile to process this file
#endif

#include <string.h>
/*
 *
 */
class Option
{
private:
	unsigned char code;
	unsigned char len;
	char *data;
public:
	Option();
	Option(unsigned char code, unsigned char len, const char* data);
	Option(const Option &copy);
	Option& operator=(const Option &ob);
	bool operator==(const Option &other);
	virtual ~Option();
    unsigned char GetCode() const;
    unsigned char GetLen() const;
    char *GetData() const;
    void GetOption(unsigned char &code, unsigned char &len, char *data) const;
    size_t GetSize() const;//возвращает размер всех полей
    void SetCode(unsigned char code);
    void SetLen(unsigned char len);
    void SetLenData(unsigned char len, const char *data);
    void SetOption(unsigned char code, unsigned char len, const char* data);
};

#endif /* OPTION_HPP_ */
